/*
 * Copyright 2013 Alibaba.com All right reserved. This software is the
 * confidential and proprietary information of Alibaba.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Alibaba.com.
 */
package com.yunos.tv.biz.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.yunos.tv.biz.service.IUserService;
import com.yunos.tv.common.util.DigestUtil;
import com.yunos.tv.dal.dao.IUserDao;
import com.yunos.tv.dal.domain.UserDomain;

/**
 * 类UserServiceImpl.java的实现描述：TODO 类实现描述
 * @author riqi 2013-7-1 下午5:06:40
 */
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao userDao;

    @Override
    public int addUser(UserDomain userDomain) {
        userDomain.setPassword(DigestUtil.MD5_32(userDomain.getPassword()));
        return userDao.addUser(userDomain);
    }

    @Override
    public int deleteUser(Integer uid) {
        return userDao.deleteUser(uid);
    }

    @Override
    public int updateUser(UserDomain userDomain) {
        return userDao.updateUser(userDomain);
    }

    @Override
    public UserDomain getUser(Integer uid) {
        return userDao.getUser(uid);
    }

    @Override
    public UserDomain getUserByUsername(String username) {
        return userDao.getUserByUsername(username);
    }

    @Override
    public int getCount() {
        return userDao.getCount();
    }

    @Override
    public int getCount(Integer uid) {
        return userDao.getCount(uid);
    }

    @Override
    public List<UserDomain> getUsers(List<Integer> uids) {
        return userDao.getUsers(uids);
    }

}
